﻿using System;
using System.Linq;
using System.Text;
using Com.DAO;
using WF.Common;
using Centaline.WebControl;

namespace WF.BusinessObject
{
    /// <summary>
    /// Log 的摘要说明。

    /// </summary>
    public class Log : Com.DAO.BusinessEntiry
    {
        public Log(DataManager dataManager)
            : base(dataManager, "CQCCAILog.dbo.SYS_Log", "LogID")
        {

        }

        public static void BindDataGrid(CentaDataGrid dataGrid, DataManager dataManager)
        {
            string sql = "select * from CQCCAILog.dbo.VW_SYS_Log";
            CentaUtil.BindDataGrid(dataManager, dataGrid, sql);
        }

        public static void DeleteByTimeScope(string beginDate, string endDate, DataManager dataManager)
        {
            string sql = "delete CQCCAILog.dbo.SYS_Log where 1=1";
            if (beginDate != "")
            {
                sql = sql + " and OpDate >= '" + beginDate + "'";
            }
            if (endDate != "")
            {
                sql = sql + " and Convert(varchar(10),OpDate,120) <= '" + endDate + "'";
            }
            dataManager.Execute(sql);
        }
    }
}
